package com.john.market.classes;

import java.util.UUID;

import com.john.market.constants.ProductType;

/**
 * Product for market 
 *
 */
public class Product {
	// Product ID
	private UUID mId = UUID.randomUUID();
	
	// Product title 
	private String mTitle = "Unknown product";
	
	// Product type
	private ProductType mType = ProductType.TYPE_MISC;
	
	// Product amount
	private int mAmount = 1;
	
	// Product price
	private float mPrice = 1f;
	
	/**
	 * Creates new product object with default values
	 * 
	 */
	public Product() {}
	
	/**
	 * Creates copy of another product object
	 * 
	 */
	public Product(Product product) {
		this.mId = product.getId();
		this.mTitle = product.getTitle();
		this.mType = product.getType();
		this.mAmount = product.getAmount();
		this.mPrice = product.getPrice();		
	}

	/**
	 * Creates new product object with custom values  
	 * 
	 * @param title
	 * Product title
	 * 
	 * @param type
	 * Product type
	 * 
	 * @param amount
	 * Product amount
	 * 
	 * @param price
	 * Product price
	 * 
	 */
	public Product(String title, ProductType type, int amount, float price) {
		this.mTitle = title;
		this.mType = type;
		this.mAmount = amount;
		this.mPrice = price;
	}

	/**
	 * PRoduct ID getter
	 * 
	 * @return
	 * Product ID
	 * 
	 */
	public UUID getId() {
		return this.mId;
	}
	
	/**
	 * Product ID setter
	 * 
	 * @param id
	 * Product ID
	 * 
	 */
	public void setId(UUID id) {
		this.mId = id;
	}

	/**
	 * Product title getter
	 * 
	 * @return
	 * Product title
	 * 
	 */
	public String getTitle() {
		return this.mTitle;
	}

	/**
	 * Product title setter
	 * 
	 * @param title
	 * Product title
	 * 
	 */
	public void setTitle(String title) {
		this.mTitle = title;
	}

	/**
	 * Product type getter
	 * 
	 * @return
	 * Product type
	 * 
	 */
	public ProductType getType() {
		return this.mType;
	}

	/**
	 * Product type setter
	 * 
	 * @param type
	 * Product type
	 * 
	 */
	public void setType(ProductType type) {
		this.mType = type;
	}

	/**
	 * Product amount getter
	 * 
	 * @return
	 * Product amount
	 * 
	 */
	public int getAmount() {
		return this.mAmount;
	}

	/**
	 * Product amount setter
	 * 
	 * @param amount
	 * Product amount
	 * 
	 */
	public void setAmount(int amount) {
		this.mAmount = amount;
	}

	/**
	 * Product price getter
	 * 
	 * @return
	 * Product price
	 * 
	 */
	public float getPrice() {
		return this.mPrice;
	}

	/**
	 * Product price setter
	 * 
	 * @param price
	 * Product price
	 * 
	 */
	public void setPrice(float price) {
		this.mPrice = price;
	}
	
}